/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package cube.sensors;

/**
 *
 * @author akermanl
 */
public class LIS3LV02DQ {

    private int measurementRange;
    private double vdd;

    private Object[][] infos2g25vdd = {
                            { "Measurement range", "1", "±1.8", "±2.0", "g" },
                            { "Device Resolution", "", "1.0", "", "mg" },
                            { "Sensitivity", "974", "1024", "1074", "LSb/g" },
                            { "Sensitivity Change Vs Temperature Full-scale", "",  "0.025", "" ,"%/°C " },
                            { "Zero-g Level Offset Accuracy (X,Y)", "-20", "", "+20", "mg" },
                            { "Zero-g Level Offset Accuracy (Z)", "-40", "", "+40", "mg" },
                            { "Zero-g Level Offset Long Term Accuracy (X,Y)", "-2", "", "+2", "%FS" },
                            { "Zero-g Level Offset Long Term Accuracy (Z)", "-5", "", "+5", "%FS" },
                            { "Zero-g Level Change Vs Temperature", "", "0.2", "",  "mg/°C" },
                            { "Non Linearity (X,Y)", "", "±2", "", "%FS" },
                            { "Non Linearity (Z)", "", "±3", "", "%FS" },
                            { "Cross Axis", "-3.5", "",  "3.5", "%" },
                            { "Self test Output Change (X,Y)", "100", "240", "400", "LSb" },
                            { "Self test Output Change (Z)", "30", "150", "350", "LSb" },
                            { "System Bandwidth", "", "ODRx/4", "", "Hz" },
                            { "Operating Temperature Range", "-40", "", "+85", "°C" },
                            { "Product Weight ", "", "0.2", "", "gram" },
    };

    private Object[][] infos6g25vdd = {
                            { "Measurement range", "1", "±5.6", "±6.0", "g" },
                            { "Device Resolution", "", "1.0", "", "mg" },
                            { "Sensitivity", "323", "340", "357", "LSb/g"  },
                            { "Sensitivity Change Vs Temperature Full-scale", "",  "0.025", "" ,"%/°C " },
                            { "Zero-g Level Offset Accuracy (X,Y)", "-40", "", "+40", "mg" },
                            { "Zero-g Level Offset Accuracy (Z)", "-60", "", "+60", "mg" },
                            { "Zero-g Level Offset Long Term Accuracy (X,Y)", "-1", "", "+1", "%FS" },
                            { "Zero-g Level Offset Long Term Accuracy (Z)", "-2", "", "+2", "%FS" },
                            { "Zero-g Level Change Vs Temperature", "", "0.2", "",  "mg/°C" },
                            { "Non Linearity (X,Y)", "", "±2", "", "%FS" },
                            { "Non Linearity (Z)", "", "±3", "", "%FS" },
                            { "Cross Axis", "-3.5", "",  "3.5", "%" },
                            { "Self test Output Change (X,Y)", "30", "80", "130", "LSb" },
                            { "Self test Output Change (Z)", "10", "50", "120", "LSb" },
                            { "System Bandwidth", "", "ODRx/4", "", "Hz" },
                            { "Operating Temperature Range", "-40", "", "+85", "°C" },
                            { "Product Weight ", "", "0.2", "", "gram" },
    };

    private Object[][] infos2g33vdd = {
                            { "Measurement range", "1", "±1.7", "±2.0", "g" },
                            { "Device Resolution", "", "1.0", "", "mg" },
                            { "Sensitivity", "920", "1024", "1126", "LSb/g" },
                            { "Sensitivity Change Vs Temperature Full-scale", "",  "0.025", "" ,"%/°C " },
                            { "Zero-g Level Offset Accuracy (X,Y)", "-70", "", "+70", "mg" },
                            { "Zero-g Level Offset Accuracy (Z)", "-90", "", "+90", "mg" },
                            { "Zero-g Level Offset Long Term Accuracy (X,Y)", "-4.5", "", "+4.5", "%FS" },
                            { "Zero-g Level Offset Long Term Accuracy (Z)", "-6", "", "+6", "%FS" },
                            { "Zero-g Level Change Vs Temperature", "", "0.2", "",  "mg/°C" },
                            { "Non Linearity (X,Y)", "", "±2", "", "%FS" },
                            { "Non Linearity (Z)", "", "±3", "", "%FS" },
                            { "Cross Axis", "-3.5", "",  "3.5", "%" },
                            { "Self test Output Change (X,Y)", "250", "500", "900", "LSb" },
                            { "Self test Output Change (Z)", "100", "350", "600", "LSb" },
                            { "System Bandwidth", "", "ODRx/4", "", "Hz" },
                            { "Operating Temperature Range", "-40", "", "+85", "°C" },
                            { "Product Weight ", "", "0.2", "", "gram" },
    };

        private Object[][] infos6g33vdd = {
                            { "Measurement range", "1", "±5.3", "±6.0", "g" },
                            { "Device Resolution", "", "1.0", "", "mg" },
                            { "Sensitivity", "306", "340", "374", "LSb/g" },
                            { "Sensitivity Change Vs Temperature Full-scale", "",  "0.025", "" ,"%/°C " },
                            { "Zero-g Level Offset Accuracy (X,Y)", "-90", "", "+90", "mg" },
                            { "Zero-g Level Offset Accuracy (Z)", "-100", "", "+100", "mg" },
                            { "Zero-g Level Offset Long Term Accuracy (X,Y)", "-1.8", "", "+1.8", "%FS" },
                            { "Zero-g Level Offset Long Term Accuracy (Z)", "-2.2", "", "+2.2", "%FS" },
                            { "Zero-g Level Change Vs Temperature", "", "0.2", "",  "mg/°C" },
                            { "Non Linearity (X,Y)", "", "±2", "", "%FS" },
                            { "Non Linearity (Z)", "", "±3", "", "%FS" },
                            { "Cross Axis", "-3.5", "",  "3.5", "%" },
                            { "Self test Output Change (X,Y)", "80", "180", "300", "LSb" },
                            { "Self test Output Change (Z)", "30", "120", "200", "LSb" },
                            { "System Bandwidth", "", "ODRx/4", "", "Hz" },
                            { "Operating Temperature Range", "-40", "", "+85", "°C" },
                            { "Product Weight ", "", "0.2", "", "gram" },
    };

    public LIS3LV02DQ(int measurementRange, double vdd){
        this.measurementRange = measurementRange;
        this.vdd = vdd;
    }

    /**
     * @return the measurementRange
     */
    public int getMeasurementRange() {
        return measurementRange;
    }

    /**
     * @return the vdd
     */
    public double getVdd() {
        return vdd;
    }

    /**
     * @param vdd the vdd to set
     */
    public void setVdd(double vdd) {
        this.vdd = vdd;
    }

    /**
     * @param measurementRange the measurementRange to set
     */
    public void setMeasurementRange(int measurementRange) {
        this.measurementRange = measurementRange;
    }
    
    public Object[][] getInfos(){
        if ((getMeasurementRange() == 2) && (getVdd() == 2.5)) {
            return infos2g25vdd;
        } else if ((getMeasurementRange() == 6) && (getVdd() == 2.5)) {
            return infos6g25vdd;
        } else if ((getMeasurementRange() == 2) && (getVdd() == 3.3)) {
            return infos2g33vdd;
        } else {
            return infos6g33vdd;
        }
    }

}
